/ .. / / -> download
<?xml version="1.0" encoding="UTF-8"?>
<!--************************************************************************************************************
**		
**		S1000D Issue 4.0/4.0.1 - Stylesheet for US Army page-based TMs 
**		IPD - Illustrated Parts Data 
**		
**		The following elements are prohibited by Army and NOT included in this template: 
**		fullNatoStockNumber, initialProvisioningProject
**		
**		
**		BTAS 12-21-10
**		8/26/11 - kr - referenced common column-title attributes on column titles
**		
****************************************************************************************************************-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">

<!--************************************************************************************************************
**		Repair Parts Information
**		IC/V: 607E
**		
**		One Functional Group Code per data module. (3031, 5.93.5.1.1)
**		Within <illustratedPartsCatalog>: Either <figure> or <multimedia>, but one must exist.
**		After figure/multimedia, tabular data is displayed as follows: Army - 7 columns, MC - 8 columns
**		
****************************************************************************************************************-->
	<!-- 3031: Font sizes 8 to 10 shall be used for Illustrated Parts Data. -->
	<xsl:template match="illustratedPartsCatalog">
		<xsl:apply-templates select="figure"/>
		<fo:table border-bottom="solid" border-bottom-width=".5pt" 
			border-top="solid" border-top-width=".5pt" font-size="8pt" 
			margin-bottom="8pt" margin-left="3pt" margin-right="3pt" margin-top="8pt" 
			relative-position="static" space-after.maximum="12pt" space-after.minimum="12pt" 
			space-after.optimum="12pt" space-before.maximum="14pt" space-before.minimum="12pt" 
			space-before.optimum="12pt" span="all" table-layout="fixed" table-omit-header-at-break="true" 
			table-omit-footer-at-break="true" text-align="left" white-space-treatment="preserve" 
			width="7.0in" hyphenate="true">
			<xsl:choose>
				<xsl:when test="//service='USM'">
					<fo:table-column column-number="1" column-width="6%"/>
					<fo:table-column column-number="2" column-width="8%"/>
					<fo:table-column column-number="3" column-width="17%"/>
					<fo:table-column column-number="4" column-width="8%"/>
					<fo:table-column column-number="5" column-width="17%"/>
					<fo:table-column column-number="6" column-width="31%"/>
					<fo:table-column column-number="7" column-width="6%"/>
					<fo:table-column column-number="8" column-width="7%"/>
				</xsl:when>
				<xsl:otherwise>
					<fo:table-column column-number="1" column-width="6%"/>
					<fo:table-column column-number="2" column-width="10%"/>
					<fo:table-column column-number="3" column-width="18%"/>
					<fo:table-column column-number="4" column-width="9%"/>
					<fo:table-column column-number="5" column-width="18%"/>
					<fo:table-column column-number="6" column-width="33%"/>
					<fo:table-column column-number="7" column-width="6%"/>
				</xsl:otherwise>
			</xsl:choose>
			<xsl:call-template name="PI-HEADER"/>
			<fo:table-body>
				<xsl:call-template name="FGCHEAD"/>
				<xsl:apply-templates select="catalogSeqNumber"/> 
				<xsl:call-template name="GROUPEND"/>
			</fo:table-body>
		</fo:table>
	</xsl:template>
	
	<xsl:template name="PI-HEADER">
		<fo:table-header>
			<fo:table-row>
				<fo:table-cell  xsl:use-attribute-sets="table.cell.padding column-title" 
					border-bottom="solid" border-bottom-width=".5pt" display-align="after" 
					font-size="8pt" text-align="center" column-number="1">
					<fo:block>(1)</fo:block>
					<fo:block>ITEM</fo:block>
					<fo:block>NO.</fo:block>
				</fo:table-cell>
				<fo:table-cell  xsl:use-attribute-sets="table.cell.padding column-title" 
					border-bottom="solid" border-bottom-width=".5pt" display-align="after" 
					font-size="8pt" text-align="center" column-number="2">
					<fo:block>(2)</fo:block>
					<fo:block>SMR</fo:block>
					<fo:block>CODE</fo:block>
				</fo:table-cell>
				<fo:table-cell  xsl:use-attribute-sets="table.cell.padding column-title" 
					border-bottom="solid" border-bottom-width=".5pt" display-align="after" 
					font-size="8pt" text-align="center" column-number="3">
					<fo:block>(3)</fo:block>
					<fo:block> </fo:block>
					<fo:block>NSN</fo:block>
				</fo:table-cell>
				<fo:table-cell  xsl:use-attribute-sets="table.cell.padding column-title" 
					border-bottom="solid" border-bottom-width=".5pt" display-align="after" 
					font-size="8pt" text-align="center" column-number="4">
					<fo:block>(4)</fo:block>
					<fo:block> </fo:block>
					<fo:block>CAGEC</fo:block>
				</fo:table-cell>
				<fo:table-cell  xsl:use-attribute-sets="table.cell.padding column-title" 
					border-bottom="solid" border-bottom-width=".5pt" display-align="after" 
					font-size="8pt" text-align="left" column-number="5">
					<fo:block>(5)</fo:block>
					<fo:block>PART</fo:block>
					<fo:block>NUMBER</fo:block>
				</fo:table-cell>
				<fo:table-cell  xsl:use-attribute-sets="table.cell.padding column-title" 
					border-bottom="solid" border-bottom-width=".5pt" display-align="after" 
					font-size="8pt" text-align="left" column-number="6">
					<fo:block>(6)</fo:block>
					<fo:block>DESCRIPTION AND USABLE</fo:block>
					<fo:block>ON CODE (UOC)</fo:block>
				</fo:table-cell>
				<fo:table-cell  xsl:use-attribute-sets="table.cell.padding column-title" 
					border-bottom="solid" border-bottom-width=".5pt" display-align="after" 
					font-size="8pt" text-align="left" column-number="7">
					<fo:block>(7)</fo:block>
					<fo:block> </fo:block>
					<fo:block>QTY</fo:block>
				</fo:table-cell>
				<!--*********************************************************************************************
				**		
				**		Marine Corps requires this additional column:
				**		
				*************************************************************************************************-->
				<xsl:if test="//service='USM'">
					<fo:table-cell  xsl:use-attribute-sets="table.cell.padding column-title" 
						border-bottom="solid" border-bottom-width=".5pt"
						display-align="after" font-size="8pt" 
						padding-bottom="4pt" padding-top="4pt" text-align="center"
						column-number="8">
						<fo:block>(8)</fo:block>
						<fo:block>USMC QTY</fo:block>
						<fo:block>per Equip</fo:block>
					</fo:table-cell>
				</xsl:if>
			</fo:table-row>
		</fo:table-header>
	</xsl:template>
	
	<!--*********************************************************************************************
	**		FUNCTIONAL GROUP HEADER
	**		identAndStatusSection/dmStatus/functionalItemCode = FGC and title (1st line)
	**		
	**		Figure titles shall be taken from provisioning documentation. Figure title, functional
	**		group title, and applicable MAC title shall be the same.
	**		
	**		Figure number and title (same title as above) (2nd line) (40051 used <fnctitle>
	**		for both of these titles, for S1000D use: <dmTitle> or just figure title?)
	*************************************************************************************************-->
	<xsl:template name="FGCHEAD">
		<xsl:variable name="figNo">
			<xsl:value-of select="string-length(catalogSeqNumber[1]/@catalogSeqNumberValue)-6"/>
		</xsl:variable>
		<xsl:variable name="IPDType">
			<xsl:value-of select="//dmodule/identAndStatusSection/dmAddress/dmIdent/dmCode/@infoCode"/>
			<xsl:value-of select="//dmodule/identAndStatusSection/dmAddress/dmIdent/dmCode/@infoCodeVariant"/>
		</xsl:variable>
		<!-- MIL-STD-3031, 5.93.7 - The functional group number and title shall be "SPECIAL TOOLS (REPAIR PARTS) ((IC 607B))" -->
		<!-- MIL-STD-3031, 5.93.8 - The functional group number and title shall be "REPAIR KITS" (IC 607C) -->
		<!-- MIL-STD-3031, 5.93.9 - The functional group number and title shall be "BULK MATERIAL" (IC 603B) -->
		<!-- MIL-STD-3031, 5.93.10 - The functional group number and title shall be "SPECIAL TOOLS" (IC 604B) -->
		<fo:table-row>
			<fo:table-cell  xsl:use-attribute-sets="table.cell.padding" column-number="6">
				<fo:block>GROUP <xsl:value-of select="//identAndStatusSection/dmStatus/functionalItemCode"/>  
					<xsl:choose>
						<xsl:when test="$IPDType='607B'">SPECIAL TOOLS (REPAIR PARTS)</xsl:when>
						<xsl:when test="$IPDType='607C'">REPAIR KITS</xsl:when>
						<xsl:when test="$IPDType='603B'">BULK MATERIAL</xsl:when>
						<xsl:when test="$IPDType='604B'">SPECIAL TOOLS</xsl:when>
						<xsl:when test="$IPDType='607E'"><xsl:value-of select="//catalogSeqNumber[1]/preceding-sibling::figure/title"/></xsl:when>
						<xsl:otherwise>Are you sure the infocode is right?</xsl:otherwise>
					</xsl:choose>
				</fo:block>
			</fo:table-cell>
		</fo:table-row>
		<fo:table-row>
			<fo:table-cell  xsl:use-attribute-sets="table.cell.padding" column-number="6">
				<fo:block>FIGURE <xsl:value-of select="substring(//catalogSeqNumber[1]/@catalogSeqNumberValue, $figNo, 2)"/>  <xsl:value-of select="//catalogSeqNumber[1]/preceding-sibling::figure/title"/></fo:block>
			</fo:table-cell>
		</fo:table-row>
		<fo:table-row>
			<fo:table-cell  xsl:use-attribute-sets="table.cell.padding" column-number="6">
				<fo:block> </fo:block>
			</fo:table-cell>
		</fo:table-row>
	</xsl:template>
	
	<xsl:template match="catalogSeqNumber">
		<fo:table-row keep-together.within-page="always" wrap-option="wrap">
			<fo:table-cell  xsl:use-attribute-sets="table.cell.padding" text-align="center">
				<fo:block>
					<!-- S1000D - Where an item is listed but not illustrated on the accompanying illustration, 
						this must be marked with a dash in this column and on the same line as the item number.  -->
					<xsl:choose>
						<xsl:when test="./itemSequenceNumber/partLocationSegment/notIllustrated">
							<xsl:text>-</xsl:text>
						</xsl:when>
						<xsl:when test="@catalogItemNumber">
							<xsl:value-of select="@catalogItemNumber"/>
						</xsl:when>
						<xsl:when test="@catalogSeqNumberValue">
							<xsl:value-of select="substring(@catalogSeqNumberValue, (string-length(@catalogSeqNumberValue)-3), 3)"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="@catalogItemNumber"/>
						</xsl:otherwise>
					</xsl:choose>
				</fo:block>
			</fo:table-cell>
			<fo:table-cell  xsl:use-attribute-sets="table.cell.padding" text-transform="uppercase" text-align="center">
				<fo:block>
					<xsl:value-of select="./itemSequenceNumber/locationRcmdSegment/locationRcmd/sourceMaintRecoverability"/>
				</fo:block>
			</fo:table-cell>
			<fo:table-cell  xsl:use-attribute-sets="table.cell.padding" text-align="center">
				<fo:block>
					<xsl:if test="./itemSequenceNumber/natoStockNumber">
						<xsl:value-of select="./itemSequenceNumber/natoStockNumber/@natoSupplyClass"/>-<xsl:value-of select="./itemSequenceNumber/natoStockNumber/@natoCodificationBureau"/>-<xsl:value-of select="substring(./itemSequenceNumber/natoStockNumber/@natoItemIdentNumberCore, 1, 3)"/>-<xsl:value-of select="substring(./itemSequenceNumber/natoStockNumber/@natoItemIdentNumberCore, 4, 4)"/>
					</xsl:if>
				</fo:block>
			</fo:table-cell>
			<fo:table-cell  xsl:use-attribute-sets="table.cell.padding" text-transform="uppercase" text-align="center">
				<fo:block>
					<xsl:value-of select="./itemSequenceNumber/manufacturerCode"/>
				</fo:block>
			</fo:table-cell>
			<fo:table-cell xsl:use-attribute-sets="table.cell.padding" text-transform="uppercase" wrap-option="wrap">
				<fo:block wrap-option="wrap">
					<xsl:value-of select="./itemSequenceNumber/partNumber"/>
				</fo:block>
			</fo:table-cell>
			<!-- MIL-STD-3031: 5.37.1.28 Component indenture. The component shall be indented two positions and listed 
				by item name (element <partIdentSegment>), the figure number (attribute catalogSeqNumberValue in 
				element <catalogSeqNumber>), and the item numbers (attribute catalogItemNumber or attribute 
				catalogSeqNumberValue in element <catalogSeqNumber>).-->
			<!-- MIL-STD-3031:	5.37.1.29 
				Catalog sequence number shall not exceed five levels of indenture (the value of the 
				attribute indenture in <catalogSeqNumber> shall not exceed "5").-->
			<fo:table-cell xsl:use-attribute-sets="table.cell.padding">
				<fo:block>
					<xsl:if test="./@indenture">
						<xsl:choose>
							<xsl:when test="./@indenture=1"> </xsl:when>
							<xsl:when test="./@indenture=2"> . </xsl:when>
							<xsl:when test="./@indenture=3"> . . </xsl:when>
							<xsl:when test="./@indenture=4"> . . . </xsl:when>
							<xsl:when test="./@indenture=5"> . . . . </xsl:when>
							<xsl:when test="./@indenture=6">
								<fo:inline color="red">
									<xsl:text>Error: No more than 5 levels of indenture are allowed in IPD.</xsl:text>
								</fo:inline>	
							</xsl:when>
							<xsl:when test="./@indenture=7">
								<fo:inline color="red">
									<xsl:text>Error: No more than 5 levels of indenture are allowed in IPD.</xsl:text>
								</fo:inline>	
							</xsl:when>
						</xsl:choose>
					</xsl:if>
					<!-- MIL-STD-3031 - 5.37.1.7 
						When survivability considerations are specified and Hardness Critical Items [HCI] are 
						identified on drawings and parts lists, the items shall be marked and identified in the
						DESCRIPTION entry-->
					<!-- MIL-STD-3031 - 5.37.1.8 
						If electronic equipment to be handled, inspected, repaired or assembled is ESD sensitive, 
						the items shall be marked and identified in the ―DESCRIPTION entry. -->
					<!-- MIL-STD-3031 - 5.37.1.25 Part characteristic. 
						The attribute partCharacteristic shall be used when appropriate conditions are present. -->
					<xsl:if test="./itemSequenceNumber/@partCharacteristic">
						<xsl:choose>
							<xsl:when test="./itemSequenceNumber/@partCharacteristic='pc00'"/>
							<xsl:when test="./itemSequenceNumber/@partCharacteristic='pc01'">
								<fo:inline font-weight="bold">HCI </fo:inline>
							</xsl:when>
							<xsl:when test="./itemSequenceNumber/@partCharacteristic='pc03'">
								<fo:inline font-weight="bold">MRP </fo:inline>
							</xsl:when>
							<xsl:when test="./itemSequenceNumber/@partCharacteristic='pc04'">
								<fo:inline font-weight="bold">CSI </fo:inline>
							</xsl:when>
							<xsl:when test="./itemSequenceNumber/@partCharacteristic='pc05'">
								<fo:inline font-weight="bold">TEREQ </fo:inline>
							</xsl:when>
							<xsl:when test="./itemSequenceNumber/@partCharacteristic='pc06'">
								<fo:inline font-weight="bold">ESD </fo:inline>
							</xsl:when>
							<xsl:otherwise>
								<fo:inline font-weight="bold" color="red">Error: Attribute value not allowed. </fo:inline>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:if>
					<xsl:value-of select="./itemSequenceNumber/partIdentSegment/descrForPart"/>
						<xsl:if test="./itemSequenceNumber/applicabilitySegment">
							<fo:block>
							<!--*********************************************************************************************
							**		
							**		MIL-STD-3031, 5.93.5.1.4
							**		When an item is used on all configurations or when only one configuration is 
							**		covered by the parts list, UOCs shall not be shown.
							**		MIL-STD-3031, 5.37.1.13 
							**      Usable on code. UOC shall be placed on the last line under the item description. 
							**      The letters "UOC:" followed by the applicable UOC shall be indented.
							**		MIL-STD-3031, 
							**
							*************************************************************************************************-->
									<xsl:if test="./itemSequenceNumber/applicabilitySegment/usableOnCodeEquip">
										<xsl:text>     UOC: </xsl:text><xsl:value-of select="./itemSequenceNumber/applicabilitySegment/usableOnCodeEquip"/>
									</xsl:if>
									<xsl:if test="./itemSequenceNumber/applicabilitySegment/usableOnCodeAssy">
										<xsl:text>     UOC: </xsl:text><xsl:value-of select="./itemSequenceNumber/applicabilitySegment/usableOnCodeAssy"/>
									</xsl:if>
							</fo:block>
						</xsl:if>
						<xsl:if test="./itemSequenceNumber/locationRcmdSegment/locationRcmd/modelVersion">
							<fo:block>
								<xsl:text>     Model: </xsl:text>
								<xsl:value-of select="./itemSequenceNumber/locationRcmdSegment/locationRcmd/modelVersion/@modelVersionValue"/>
							</fo:block>
							<fo:block>
								<!--*********************************************************************************************
								**		
								**		MIL-STD-3031A, 5.93.5.1.4
								**		When  part numbers of spare/repair items are not the same for all serial 
								**		numbered equipment of the same model, a statement identifying the Usable 
								**		Effective serial numbers shall be placed on the last line under the item 
								**		description. When an item is used on all models or when only one configuration 
								**		is covered by the parts list, serial number shall not be shown.
								**		
								**		MIL-STD-3031A, 5.37.1.23 
								**		Part numbers. When part numbers of spare/repair items are not the same for all serial 
								**		numbered equipment of the same model, a statement identifying the Usable Effective 
								**		(USBL EFF) serial numbers shall be added to the item description (e.g., USBL EFF SER 
								**		NOS 1719-1941)
								**
								** 		MIL-STD-3031A, 5.37.1.48 
								**		Model version. The allowable values for the element <modelVersion> shall match the allowable 
								**		values for Usable Effective (USBL EFF) serial numbers, contained within <effectivity>.
								**		
								*************************************************************************************************-->
								<xsl:text>     USBL EFF SER NOS </xsl:text><xsl:value-of select="./itemSequenceNumber/locationRcmdSegment/locationRcmd/modelVersion/effectivity"/>
							</fo:block>
						</xsl:if>
					<!-- MIL-STD-3031A, 5.37.1.36 Basis of Issue (BOI). When authoring BOI data for special tools lists (IC 604B), 
						BOI shall be recorded using the generic part data elements. The attribute genericPartDataName will be set 
						to "basisOfIssue" and the value shall be identified using the element <genericPartDataValue>. -->
					<xsl:apply-templates select="./itemSequenceNumber/genericPartDataGroup/genericPartData[@genericPartDataName='basisOfIssue']"/>
					<xsl:if test="./itemSequenceNumber/partLocationSegment/selectOrManufactureFromIdent/@selectOrManufactureValue='m'">
						<fo:block><xsl:text>     MAKE FROM </xsl:text> 
							<xsl:value-of select="./itemSequenceNumber/partLocationSegment/selectOrManufactureFromIdent/selectOrManufacture"/>
						</fo:block>
					</xsl:if>
				</fo:block>
			</fo:table-cell>
			<fo:table-cell xsl:use-attribute-sets="table.cell.padding">
				<fo:block>
					<xsl:value-of select="./itemSequenceNumber/quantityPerNextHigherAssy"/>
				</fo:block>
			</fo:table-cell>
			<!-- MIL-STD-3001 - 5.37.1.37 Quantity per end item.
				Quantity per end item (Marine Corps only) shall be recorded using the generic part data elements. The attribute 
				genericPartDataName shall be set to "qtyPerEndItem" and the value shall be identified using the element <genericPartDataValue>.-->
			<xsl:if test="//service='USM'">
				<fo:table-cell xsl:use-attribute-sets="table.cell.padding">
					<xsl:apply-templates select="./itemSequenceNumber/genericPartDataGroup/genericPartData[@genericPartDataName='qtyPerEndItem']"/>
				</fo:table-cell>
			</xsl:if>	
		</fo:table-row>			
	</xsl:template>
	
	<xsl:template match="genericPartData">
		<xsl:if test="@genericPartDataName='basisOfIssue'">
			<fo:block><xsl:text>     BOI: </xsl:text> 
				<xsl:value-of select="genericPartDataValue"/>
			</fo:block>
		</xsl:if>
		<xsl:if test="@genericPartDataName='qtyPerEndItem'">
			<fo:block>
				<xsl:value-of select="genericPartDataValue"/>
			</fo:block>
		</xsl:if>
	</xsl:template>
	
	<xsl:template name="GROUPEND">
	<!--*********************************************************************************************
	**		MIL-STD-3031A, 5.93.4.1.1
	**		END OF FIGURE should appear for Illustrated parts lists.
	*************************************************************************************************-->
		<fo:table-row>
			<fo:table-cell  xsl:use-attribute-sets="table.cell.padding" column-number="6">
				<fo:block> </fo:block>
			</fo:table-cell>
		</fo:table-row>
		<fo:table-row>
			<fo:table-cell  xsl:use-attribute-sets="table.cell.padding" column-number="6">
				<fo:block font-weight="bold">END OF FIGURE</fo:block>
			</fo:table-cell>
		</fo:table-row>
	</xsl:template>
	
	<!-- MIL-STD-3031 - 5.37.1.42 Fitment code.
		The element <fitmentCode> shall be used when modification is required to fit the part to the equipment. 
		(Note: There is no Army requirement (or option) to display this information.) -->
	<xsl:template match="fitmentCode"/>
	
	<!-- MIL-STD-3031 - 5.37.1.41 Special storage.
		The element <specialStorage> shall be used when there are special storage requirements for the part. 
		(Note: There is no Army requirement (or option) to display this information.)
	-->
	<xsl:template match="specialStorage"/>
	
	<!-- MIL-STD-3031 - 5.37.1.47 Interchangeability.
		The element <interchangeability> shall be used when two or more parts have the same form, fit, and function. 
		(Note: There is no Army requirement (or option) to display this information.)
	-->
	<xsl:template match="interchangeability"/>
	<xsl:template match="applicabilitySegment"/>
	<xsl:template match="itemSequenceNumber"/>
	<xsl:template match="partIdentSegment"/>
	<xsl:template match="attachStoreShipPart"/>
	<xsl:template match="calibrationMarker"/>
	<xsl:template match="categoryOneContainerLocation"/>
	<xsl:template match="changeAuthorityNumber"/>
	<xsl:template match="descForLocation"/>
	<xsl:template match="ilsNumber"/>
	<xsl:template match="quantityPerUnit"/>
	<xsl:template match="reasonForSelection"/>
	<xsl:template match="referenceDesignator"/>
	<xsl:template match="referTo"/>
	<xsl:template match="unitOfIssueQualificationSegment"/>
	<xsl:template match="zoneGroup"/>
</xsl:stylesheet>


/ gopher://khzae.net/0/s1kd/links/projects/3031/Army S1000D Stylesheets/FO-3031-A00-USARMY-IPD_001-00_EN-US.xsl
Styles: Light Dark Classic